package com.umbrella;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class Result {
	private Integer resultCode;
	private String resultDesc;
	private Object result;
	
	public Result(){
	}
	
	public Result(Object result){
		this.resultCode = ResultCode.SUCCESS;
		this.result = result;
	}
	
	public Result(Integer resultCode){
		this.resultCode = resultCode;
		this.resultDesc = resultCode == ResultCode.SUCCESS ? ResultCode.SUCCESS_MESSAGE : ResultCode.FAILED_MESSAGE;
	}
	public Result(Integer resultCode, String resultDesc){
		this.resultCode = resultCode;
		this.resultDesc = resultDesc;
	}	
	public Result(Object result, Integer resultCode){
		this(result);
		this.resultCode = resultCode;
	}
	
	public Result(Object result, Integer resultCode, String resultDesc){
		this(result, resultCode);
		this.resultDesc = resultDesc;
	}

	public Integer getResultCode() {
		return resultCode;
	}
	public void setResultCode(Integer resultCode) {
		this.resultCode = resultCode;
	}

	public String getResultDesc() {
		return resultDesc;
	}

	public void setResultDesc(String resultDesc) {
		this.resultDesc = resultDesc;
	}

	public Object getResult() {
		return result;
	}
	public void setResult(Object result) {
		this.result = result;
	}
}
